# 绝对值
print(abs(-20))
# 最大值 最小值
print(max([1, 2, 3, 4, 5, 6]))
print(max(1, 2, 3, 4, 5, 6))

print(min([1, 2, 3, 4, 5, 6]))
print(min(1, 2, 3, 4, 5, 6))
print(min(set([1, 2, 3, 4, 5, 6])))

# 数据类型转换函数
print(int("123"))
print(str(123))
print(bool(1 == 1))


# 定义函数
def ret():
    a = 1
    b = 2
    return a, b


result = ret()
print(result)


# 默认参数
def add_end(L=[]):
    L.append('END')
    return L


print(add_end([1, 2, 3]))
print(add_end(['x', 'y', 'z']))

# 可变参数
n1 = [1, 2, 3]
def add(*nums):
    sum = 0
    for n in nums:
        sum += n
    return sum


print(add(*n1))
